<template>
    <div v-for="(item, index) in data" :key="index">
      <div v-if="item.children && item.children.length">
        <el-sub-menu :index="item.path">
          <template #title>{{ item.name }}</template>
          <Menu :data="item.children"></Menu>
        </el-sub-menu>
      </div>
      <el-menu-item
        v-else
        :index="item.path"
        :route="{ path: item.path, query: item.query }"
        >{{ item.name }}</el-menu-item
      >
    </div>
</template>

<script setup>
const props = defineProps(['data'])
console.log('props', props)
</script>